/**
 * This class is used to store all the information of the wine
 * which extends the product class.
 * The wine class will include the attributes, year of manufacture, 
 * grape variety and wine type.
 * @author sdm21
 *
 */
public class Wines extends Product{
	private static String type = "Wine";
	private int year;
	private String wine_type;
	private String grape_variety;
	private String id;
	private String name;
	private double unit_price;
	private double case_price;
	private double abv;
	private int quantity;
	private String country_origin;

	/**
	 * Creates Wine object
	 * @param case_size integer of the number of units per case
	 * @param id String of the product's unique code
	 * @param name String of the name of the product
	 * @param unit_price double of the cost per unit of the product
	 * @param case_price double of the cost per case of the product
	 * @param type String of the type of drink this product is
	 * @param abv double of the alcoholic percentage of the product
	 * @param year int of the year the wine was made
	 * @param wine_type String red/white/sparkling etc
	 * @param grape_variety the type of grape that is used
	 * @param country_origin the country the product is from
	 * @param quantity int of the amount of this product possessed
	 */
	public Wines(String id, String name, double unit_price, double case_price, double abv, 
			String country_origin, int year, String grape_variety, String wine_type, int quantity) {
		super(id, name, unit_price, case_price, type, abv, country_origin, 12, quantity);
		this.id = id;
		this.name = name;
		this.unit_price = unit_price;
		this.case_price = case_price;
		this.abv = abv;
		this.country_origin = country_origin;
		this.year = year;
		this.wine_type = wine_type;
		this.grape_variety = grape_variety;
		this.quantity = quantity;
	}
	
	/**
	 * returns the wine type
	 * @return String wine type
	 */
	public String getWineType(){
		return wine_type;
	}
	
	/**
	 * changes the wine type
	 * @param wine_type String wine type
	 */
	public void setWineType(String wine_type){
		this.wine_type = wine_type;
	}
	
	/**
	 * returns the grape variety
	 * @return String grape_variety
	 */
	public String getGrapeVariety(){
		return grape_variety;
	}
	
	/**
	 * Changes the grape variety
	 * @param grape_variety String of the grape variety
	 */
	public void setGrapeVariety(String grape_variety){
		this.grape_variety = grape_variety;
	}
	
	/**
	 * returns the year the wine was made
	 * @return int of the year
	 */
	public int getYear(){
		return year;
	}

	/**
	 * changes the year the wine was made
	 * @param year int of the year
	 */
	public void setYear(int year){
		this.year = year;
	}
	
	/**
	 * Returns a String of the details of this product
	 */
	public String printDetails(){
		String details = String.format("%-6s", id);
		details += String.format("%-10s", type);
		details += String.format("%-20s", name);
		details += String.format("%-5s", abv);
		details += String.format("%-14s", country_origin);
		
		details += String.format("%-6s", year);
		details += String.format("%-15s", grape_variety);
		details += String.format("%-15s", wine_type);
		
		details += String.format("%-7s", unit_price);
		details += String.format("%-7s", case_price);
		details += String.format("%-17s",quantity);
		return details;
	}
}

